package com.kehutong.house.enums;

import org.coraframework.util.HashID;

public enum PropertyType implements HashID {

    RESIDENCE("0", "普通住宅"),
    QUOTIENT ("1", "住宅底商"),
    FLATS("2", "商住公寓"),
    VILLA("3", "别墅"),
    BUNGALOW("4", "洋房"),
    WRITFLOOR ("5", "写字楼"),
    OTHER("6", "其它"),
    SHOP("7", "商铺"),
    ;


    private final String id;
    private final String desc ;

    private PropertyType(String id, String desc) {
        this.id = id;
        this.desc = desc ;
    }

    public static PropertyType get(String desc) {
        PropertyType[] propertyTypes = values();
        for (PropertyType propertyType : propertyTypes) {
            if (propertyType.getDesc().equals(desc)) {
                return propertyType;
            }
        }
        return null;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getDesc() {
        return desc;
    }
}
